# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  def home_url
    url_for :controller => 'schools', :action => 'index'
  end
  
  def show_datetime(time)
    time += 8.hour # set timezone to utc, so +0800 for bj timezone
    "#{time.year}-#{time.month}-#{time.day} #{time.hour}:#{time.min}:#{time.sec}"
  end
  
  def error_explan(object, error, msg)
    return "<span class=\"errorExplan\">#{msg}</span>" if object && object.errors[error]
  end
end
